
//导入数据库操作模块
const db = require("../../db/index")
/**
 * 获取简介
 * @param {*} req 
 * @param {*} res 
 */
exports.getDescription = async (req, res) => {
    console.log('获取简介列表')
    const title = req.query.title
    console.log(title)
    const sql = 'SELECT * FROM xks_description WHERE title = ?';
    await db.query(sql, title, (err, results) => {
        if (err) {
            return res.send({
                code: 505,
                msg: '错误' + err,
                data: {}
            })
        }
        // console.log(results)
        return res.send({
            code: 200,
            msg: '成功',
            data: results[0]
        })
    })
}
